package com.sunwayhorizo.health.hl7.persistent;

import com.sunwayhorizo.health.hl7.persistent.pk.RimCoreRoleAddrPartsPK;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.TableGenerator;


@Entity
@TableGenerator(name="RoleAddrParts_IdGenerator", table="RIM_Id_Generator", pkColumnName = "pkColumn", valueColumnName = "valueColumn",pkColumnValue="Role_AddrParts")
@NamedQuery(name = "RimCoreRoleAddrParts.findAll",  query = "select o from RimCoreRoleAddrParts o")
@Table(name = "RIM_CORE_ROLE_ADDR_PARTS")
@IdClass(RimCoreRoleAddrPartsPK.class)
public class RimCoreRoleAddrParts implements Serializable {
    @Id
    @Column(name="ROLE_ID", nullable = false, insertable = false, updatable = false)    private Long roleId;
    @Id
    @Column(name="ROLE_VERSION_NUM", nullable = false, insertable = false,  updatable = false)    private Long roleVersionNum;
    @Id
    @Column(name="ADDRESS_ID", nullable = false, insertable = false,  updatable = false)    private Long addressId;
    @Id
    @GeneratedValue (strategy = GenerationType.TABLE,generator = "RoleAddrParts_IdGenerator" )
    @Column(name="ADDRESS_PART_ID", nullable = false)    private Long addressPartId;
    
    @Column(name="ADDRESS_PART_TXT")    private String literal;
    @Column(name="ADDRESS_PART_TYPE_CODE")    private String PartType;
    
    @Column(name="PART_ORDER_NUM")    private Long partOrderNum;
    
    @ManyToOne
    @JoinColumns({
    @JoinColumn(name = "ROLE_ID", referencedColumnName = "ROLE_ID"),
    @JoinColumn(name = "ROLE_VERSION_NUM", referencedColumnName = "ROLE_VERSION_NUM"),
    @JoinColumn(name = "ADDRESS_ID", referencedColumnName = "ADDRESS_ID")
    })
    private RimCoreRoleAddrs rimCoreRoleAddrs;

    public RimCoreRoleAddrParts() {
    }

    public Long getAddressId() {
        return addressId;
    }

    public void setAddressId(Long addressId) {
        this.addressId = addressId;
    }

    public Long getAddressPartId() {
        return addressPartId;
    }

    public void setAddressPartId(Long addressPartId) {
        this.addressPartId = addressPartId;
    }

    public Long getPartOrderNum() {
        return partOrderNum;
    }

    public void setPartOrderNum(Long partOrderNum) {
        this.partOrderNum = partOrderNum;
    }

    public Long getRoleId() {
        return roleId;
    }

    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }

    public Long getRoleVersionNum() {
        return roleVersionNum;
    }

    public void setRoleVersionNum(Long roleVersionNum) {
        this.roleVersionNum = roleVersionNum;
    }

    public RimCoreRoleAddrs getRimCoreRoleAddrs() {
        return rimCoreRoleAddrs;
    }

    public void setRimCoreRoleAddrs(RimCoreRoleAddrs rimCoreRoleAddrs) {
        this.rimCoreRoleAddrs = rimCoreRoleAddrs;
    }

    public void setPartType(String partType) {
        this.PartType = partType;
    }

    public String getPartType() {
        return PartType;
    }

    public void setLiteral(String literal) {
        this.literal = literal;
    }

    public String getLiteral() {
        return literal;
    }
}
